package com.gla.dao;

import com.gla.domain.Commodity;
import com.gla.domain.Type;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface CommodityMapper {


    Commodity selectCommodityById(Integer commodity_id);

    @Select("SELECT * FROM TYPE WHERE id=#{type_id}")
    Type selectTypeById(Integer type_id);

    @Delete("DELETE FROM COMMODITY WHERE id=#{commodity_id}")
    void deleteCommodityById(Integer commodity_id);

    @Update("UPDATE COMMODITY SET number=#{number} WHERE id=#{commodity_id}")
    void updateNumber(Integer commodity_id,Integer number);
}
